/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/08/15
*/
#ifndef __DIALOG_H__
#define __DIALOG_H__

#include "edui.h"
using namespace edui;

class Dialog : public EventHandler
{
public:
    Dialog();
    ~Dialog();
public:
    struct{
        Event3<Dialog*, void*, void*> close;
        Event3<Dialog*, void*, void*> yes;
        Event3<Dialog*, void*, void*> cancel;
    } evt;
    // show at window center
    void Show(IWindow* parent, const char* text, void* data1 = 0, void* data2 = 0);
    // show at pt
    void Show(IWindow* parent, const char* text, const Point pt, void* data1 = 0, void* data2 = 0);
    // show at rect center
    void Show(IWindow* parent, const char* text, const Rect rc, void* data1 = 0, void* data2 = 0);
    void Close();
protected:
    void onButtonCloseClick(Button* btn);
    void onButtonYesClick(Button* btn);
    void onButtonCancelClick(Button* btn);
protected:
    IWindow* m_wnd;
    void* m_data1;
    void* m_data2;
};


#endif